#include<iostream>
#include<cmath>
using namespace std;

int main(void) {
	int num;
	cin >> num; 
	for(int a = 0; a * a <= num; a++) {
		for(int b = a; a * a + b * b <= num; b++) {
			for(int c = b; a * a + b * b + c * c <= num; c++) {
				int d = sqrt(num - a * a - b * b - c * c);
				if(a * a + b * b + c * c + d * d == num) {
					cout << a << ends << b << ends << c << ends << d << endl;
					return 0;
				}
			}
		}
	}	
	return 0;
}
